function my_vi_bindings
  fish_vi_key_bindings
  bind -M insert -m default jj backward-char force-repaint
end
set -g fish_key_bindings my_vi_bindings

set -g fish_color_normal 67809f          # Default text color
set -g fish_color_command 67809f         # Commands like 'ls'
set -g fish_color_param 67809f           # Command parameters
set -g fish_color_autosuggestion 67809f  # Autosuggestions
set -g fish_color_operator 67809f        # Operators like '&' '|'

# Set cursor styles for different modes
set -g fish_cursor_default block
set -g fish_cursor_insert block
set -g fish_cursor_replace_one underscore

alias s='ssh '
alias llt='ls -alFtr'
alias ll='ls -alF'
alias gps='ps aux | grep '
alias ..='cd ..'
alias ...='cd ../../../'
alias c='clear'
alias mkdirp='mkdir -pv'
alias cpdir='cp -r '
alias tarc="tar czf"
alias tarx="tar xzf"
alias ax='chmod a+x'
alias rmdir='rm -rf '
alias n='nano'

alias gits='git status --ignore-submodules'
alias gitp='git pull'
alias gitb='git branch'

#Thanks: https://www.reddit.com/r/fishshell/comments/gmm9e7/customising_fish_prompt/
function pretty_path
  # by default, Fish shell does not print ~ for $HOME
  echo (pwd | sed "s|^$HOME|~|g")
end

function fish_mode_prompt
  set_color '#a05703'
  switch $fish_bind_mode
    case insert
      echo -n '[I]'
    case default
      echo -n '[N]'
    case replace_one
      echo -n '[R]'
    case '*'
      echo -n "$fish_bind_mode "
  end
  set_color normal
end

#Thanks: https://fishshell.com/docs/current/cmds/fish_git_prompt.html
function fish_prompt
  set -g __fish_git_prompt_showdirtystate true
  set -g __fish_git_prompt_showuntrackedfiles true
  set -g __fish_git_prompt_char_stateseparator ''
  set -g __fish_git_prompt_char_dirtystate '  '
  set -g __fish_git_prompt_char_untrackedfiles '  '
  set -g __fish_git_prompt_char_cleanstate " 󰸞 "
  set -g __fish_git_prompt_color a05703
  set -g __fish_git_prompt_color_prefix 829496
  set -g __fish_git_prompt_color_suffix 829496

  printf '%s' (pretty_path) (fish_git_prompt) ' $ '
end
#EOP
